import fetch from '@/utils/fetch'
// 显示所有课室
export const GetTable = (page, per_page = 10, keyword) => {
  return fetch({
    url: '/api/staff/classroom',
    method: 'get',
    params: {
      page,
      per_page,
      keyword
    }
  })
}
// 删除课室
export const Delete = (id) => {
  return fetch({
    url: `/api/staff/classroom/${id}`,
    method: 'delete'
  })
}
// 显示指定课室
export const Show = (id) => {
  return fetch({
    url: `/api/staff/classroom/${id}`,
    method: 'get'
  })
}
// 更新课室
export const Update = (id, data) => {
  return fetch({
    url: `/api/staff/classroom/${id}`,
    method: 'put',
    data
  })
}
// 禁用课室
export const DisableClassroom = (id) => {
  return fetch({
    url: `/api/staff/classroom/${id}/disable`,
    method: 'post'
  })
}
// 启用课室
export const Able = (id) => {
  return fetch({
    url: `/api/staff/classroom/${id}/able`,
    method: 'post'
  })
}
// 添加课室
export const Create = (data) => {
  return fetch({
    url: `/api/staff/classroom`,
    method: 'post',
    data
  })
}

export const editPassword = (uuid, password) => {
  return fetch({
    url: `/api/staff/${uuid}/password`,
    method: 'put',
    data: {
      password
    }
  })
}
// 获取课室额外信息
export const extraInfo = () => {
  return fetch({
    url: `/api/staff/classroom/extra-info`,
    method: 'get'
  })
}

